<%@page import="java.sql.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>获取用户信息</title>
</head>
<body>
	<%
	    Connection conn = (Connection)application.getAttribute("conn");
		String sql = "SELECT * FROM user";
		PreparedStatement ps = conn.prepareStatement(sql);
		ResultSet rs = ps.executeQuery();
		while(rs.next()){
			String userName = rs.getString("username");
			String password = rs.getString("password");
			%>
			  
			 <p>用户名   密码</p>
			 <%=userName%>   <%=password%><br>
			<%
		}
		ps.close();
		rs.close();
	%>

</body>
</html>